<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{ Title }}</title>
</head>
<body>
<h3>{{ title }}</h3>
<a href="/student/create">新增学生</a>

<table border="1">
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>年龄</th>
    </tr>
    {#从上下文对象student_list取数据#}
    {% for student in student_list %}
        <tr>
            <td>{{ student.id }}</td>
            <td>{{ student.name }}</td>
            <td>{{ student.age }}</td>
            <td>
                <a href="/student/{{ student.id }}">查看详情</a>
                <a href="/student/update/{{ student.id }}">修改</a>
                <a href="/student/delete/{{ student.id }}">删除</a>
            </td>
        </tr>
    {% endfor %}
</table>
<br>
{#是否有分页#}
{% if is_paginated %}
    {#如果有上一页#}
    {% if page_obj.has_previous %}
        <a href="/student/list?page={{ page_obj.previous_page_number }}">上一页</a>
    {% endif %}
    {#  让当前页的页码数比醒目   #}
    {% for current in paginator.page_range %}
        {% if current == page_obj.number %}
            <a href="/student/list?page={{ current }}"><b><font color="red">{{ current }}</font></b></a>
        {% else %}
            <a href="/student/list?page={{ current }}">{{ current }}</a>
        {% endif %}
    {% endfor %}
    {#是否有下一页#}
    {% if page_obj.has_next %}
        <a href="/student/list?page={{ page_obj.next_page_number }}">下一页</a>
    {% endif %}
{% endif %}



</body>
</html>





















